<?php
$this->lang->load('template');
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- saved from url=(0048)http://www.fav365.com/ball/?m=admin&c=good&a=add -->
<HTML>
<HEAD>
<TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<LINK 
href="/css/admin.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2900.3395" name=GENERATOR>
<STYLE type=text/css>
.STYLE1 {
	COLOR: #ff0000
}
</STYLE>
</HEAD>
<BODY>
<DIV class=admin_box>
  <DIV class=admin_boxtop></DIV>
  <div class=admin_boxmain>
    <?=form_open('users/save');?>
    <input type="hidden" value="<?=intval($user['id'])?>" name="id" />
    <input type="hidden" name="redirect" value="<?=site_url('users/admin')?>" />
    <table cellspacing=0 cellpadding=0 width="96%" align=center border=0>
      <tbody>
        <tr>
          <td><h1 class=title>
          	<?php if(!isset($user)):?>
            <?=$this->lang->line('tpl_act_add').$this->lang->line('tpl_user')?>
            <?php else:?>
            <?=$this->lang->line('tpl_act_edit').$this->lang->line('tpl_user')?>-
            <?=$user['username']?>
            <?php endif;?>
          </h1></td>
        </tr>
      </tbody>
    </table>
    <table class=table cellspacing=1 cellpadding=5 width="96%" align=center border=0>
      <tbody>
        <tr>
          <td class="tdbg bold" width="24%"><div align=right><?=$this->lang->line('tpl_username')?></div></td>
          <td>
		  <?php if(!empty($user['username']) && intval($this->session->userdata('roles'))!=1 ):?> 
		  <strong><?=$user['username']?></strong>
		   <input type="hidden" name="oldusername" value="<?=$user['username']?>" />
		  <?php else:?>
		   <input class=inputstyle name="username" value="<?=$user['username']?>" />
		   <input type="hidden" name="oldusername" value="<?=$user['username']?>" />  
		  <span class=STYLE1>*
          <?=sprintf($this->lang->line('required_length'),'',3,35)?>
          </span>
		  <?php endif;?>
		  </td>
        </tr>
        <?php 
		$isShow = true;
		if(isset($user)):
			$isShow =false;
		endif;
		?>
        <tr>
          <td class="tdbg bold" width="24%"><div align=right>用户密码</div></td>
          <td><input class=inputstyle name="password"  type="password">
              <?php if($isShow):?>
              <span class=STYLE1>*长度为5-12个非中文字符</span>
              <?php endif;?>
          </td>
        </tr>
        <tr>
          <td class="tdbg bold" width="24%"><div align=right>确认密码</div></td>
          <td><input class=inputstyle name="passwordConfirm" type="password">
              <?php if($isShow):?>
              <span class=STYLE1>*</span>
              <?php endif;?></td>
        </tr>
        <tr>
          <td class="tdbg bold" width="24%"><div align=right>用户姓名</div></td>
          <td><input class=inputstyle name="truename" value="<?=$user['truename']?>"></td>
        </tr>
        <tr>
          <td class="tdbg bold" width="24%"><div align=right>用户邮箱</div></td>
          <td><input class=inputstyle name="email" value="<?=$user['email']?>">
              <span class=STYLE1>*格式为ex@ex.com</span> </td>
        </tr>
        <tr>
          <td class="tdbg bold"><div align=right><?=$this->lang->line('tpl_yes')?><?=$this->lang->line('tpl_no')?>锁定</div></td>
          <td><select name="is_locked">
              <option value="0"<?php if($user['is_locked']==0):?> selected="selected"<?php endif;?>><?=$this->lang->line('tpl_no')?></option>
              <option value="1"<?php if($user['is_locked']==1):?> selected="selected"<?php endif;?>><?=$this->lang->line('tpl_yes')?></option>
            </select>
          </td>
        </tr>
        <tr>
          <td colspan=2><div align=center>
              <input class=btn type=submit value="<?=$this->lang->line('tpl_submit');?>" name=Submit>
              <input class=btn onClick=history.back(-1) type=button value="<?=$this->lang->line('tpl_returnback');?>">
          </div></td>
        </tr>
      </tbody>
    </table>
  </div>
  <DIV class=admin_boxbottom></DIV>
</DIV>
</BODY>
</HTML>
